home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / wfc007.000 / include / cnetrsrc.hpp < prev    next >
C/C++ Source or Header  |  1996-04-08  |  2KB  |  87 lines

  1. #if ! defined( NET_RESOURCE_CLASS_HEADER )
  2.  
  3. /*
  4. ** Author: Samuel R. Blackburn
  5. ** CI$: 76300,326
  6. ** Internet: sammy@sed.csc.com
  7. **
  8. ** You can use it any way you like.
  9. */
  10.  
  11. #define NET_RESOURCE_CLASS_HEADER
  12.  
  13. class CNetworkResourceInformation : public CObject
  14. {
  15.    DECLARE_SERIAL( CNetworkResourceInformation )
  16.  
  17.    private:
  18.  
  19.       void m_Initialize( void );
  20.  
  21.    public:
  22.  
  23.       CNetworkResourceInformation();
  24.       virtual ~CNetworkResourceInformation();
  25.  
  26.       /*
  27.       ** Patterned after NETRESOURCE
  28.       */
  29.  
  30.       CString   LocalName;
  31.       CString   RemoteName;
  32.       CString   Comment;
  33.       CString   Provider;
  34.       DWORD     Scope;
  35.       DWORD     Type;
  36.       DWORD     DisplayType;
  37.       DWORD     Usage;
  38.  
  39.       virtual void Copy( const NETRESOURCE *source );
  40.       virtual void Empty( void );
  41.       virtual void Serialize( CArchive& archive );
  42. };
  43.  
  44. class CNetworkResources : public CNetwork
  45. {
  46.    DECLARE_DYNAMIC( CNetworkResources )
  47.  
  48.    private:
  49.  
  50.       void m_Initialize( void );
  51.  
  52.    protected:
  53.  
  54.       HANDLE m_ResumeHandle;
  55.  
  56.       NETRESOURCE m_NetResource;
  57.  
  58.    public:
  59.  
  60.       enum Scope {
  61.                     scopeConnected  = RESOURCE_CONNECTED,
  62.                     scopeAll        = RESOURCE_GLOBALNET,
  63.                     scopePersistent = RESOURCE_REMEMBERED
  64.                  };
  65.  
  66.       enum Type  {
  67.                     typeAny   = RESOURCETYPE_ANY,
  68.                     typeDisk  = RESOURCETYPE_DISK,
  69.                     typePrint = RESOURCETYPE_PRINT
  70.                  };
  71.  
  72.       enum Usage {
  73.                     usageAll         = 0,
  74.                     usageConnectable = RESOURCEUSAGE_CONNECTABLE,
  75.                     usageContainer   = RESOURCEUSAGE_CONTAINER
  76.                  };
  77.  
  78.       CNetworkResources();
  79.       CNetworkResources( LPCTSTR machine_name );
  80.       virtual ~CNetworkResources();
  81.  
  82.       virtual BOOL Enumerate( CNetworkResourceInformation& information );
  83.       virtual BOOL GetNext( CNetworkResourceInformation& information );
  84. };
  85.  
  86. #endif // NET_RESOURCE_CLASS_HEADER
  87.